package com.rongc.client.freight.utils;


import com.rongc.client.freight.UniApplication;
import com.rongc.client.freight.base.model.BaseDic;
import com.rongc.client.freight.base.model.UserBean;
import com.rongc.client.freight.base.request.result.UserResult;

/**
 * Created by Bruce on 2017/6/24.
 */
public class UserUtils {
    public static void makeUser(UserResult result){
        UserBean user = UniApplication.getInstance().getUserInfo();
        user.setHead(result.getImg());
        user.setUserId(result.getId());
        user.setNickname(result.getNick());
        user.setPhone(result.getMobile());
        user.save();
    }

    public static void mockUser(){
        UserBean user = UniApplication.getInstance().getUserInfo();
        user.setHead("https://ss1.baidu.com/70cFfyinKgQFm2e88IuM_a/forum/pic/item/6159252dd42a2834dace5fc352b5c9ea14cebf8a.jpg");
        user.setUserId("1");
        user.setNickname("Dasm");
        user.setPhone("13554342081");
        user.setType(BaseDic.IdentityType.OWNER_TYPE);
        user.setBalance("200");
        user.setCountJD("10");
        user.setCountXD("12");
        user.setCountWY("1");
        user.setIntegral("2000");
        user.save();
    }

}
